package com.bh.service.impl;


import com.bh.mapper.UserMapper;
import com.bh.pojo.entry.Menu;
import com.bh.pojo.entry.User;
import com.bh.pojo.vo.UserVO;
import com.bh.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;


    @Override
    public Integer addUser(User user) {
       return userMapper.addUser(user);
    }

    @Override
    public User loginUser(User user) {
        User usern = userMapper.loginUser(user);
        return usern;
    }

    @Override
    public List<UserVO> findAll(String likename) {

        return userMapper.findAll(likename);
    }

    @Override
    public List<Menu> findMenuByUserId(Integer id) {
        return  userMapper.findMenuByUserId(id);
    }


}
